-- ================= HERO !!
Hero =	Character:new{
	name = "the_hero",
	sprite = "resources/char.png",
	width = 24,
	height = 32,
	-- blood will be generated
	blood = true,
}

Hero.currentState = Gameelement.stateList.default.running

function Hero.load()
	Hero.save = INI.load("hero/hero.ini")
	-- Info
	Hero.name = Hero.save.info.name
	Hero.class = Hero.save.info.class
	
	-- Stats
	Hero.skp = Hero.save.skillpoints.freeskillpoints * 1
	Hero.str = Hero.save.skillpoints.strenght
	Hero.agi = Hero.save.skillpoints.agility
	Hero.int = Hero.save.skillpoints.inteligence
	Hero.dex = Hero.save.skillpoints.dexterity 
	
	-- Hero Status
	Hero.level = Hero.save.status.level * 1
	Hero.exp = Hero.save.status.experiencepoints * 1
	Hero.hp = Hero.save.status.life * 1
	Hero.hpmax = Hero.save.status.lifemax * 1
	Hero.hpregrate = Hero.save.status.lifereg * 1
	Hero.mana = Hero.save.status.mana * 1
	Hero.manamax = Hero.save.status.manamax * 1
	Hero.manaregrate = Hero.save.status.manareg * 1
	Hero.speed =  Hero.save.status.speed * 1
	
	Hero.arrows = Hero.save.status.arrows * 1
	
	Hero.dead = 0

	-- blood enabled
	Hero.blood = true
	
	-- Heros measure
	Hero.x = 5
	Hero.y = 50
	Hero.width = 24
	Hero.height = 32
	
end

function Hero.savegame()
	-- Info
	Hero.save["info"]["name"] = "Hero.name"
	Hero.save["info"]["class"] = "Hero.class"
	
	-- Status
	Hero.save["status"]["level"] = "Hero.level"
	Hero.save["status"]["life"] = "Hero.hp"
	Hero.save["status"]["lifemax"] = "Hero.hpmax"
	Hero.save["status"]["mana"] = "Hero.mana"
	Hero.save["status"]["manareg"] = "Hero.manareg"
	Hero.save["status"]["manamax"] = "Hero.manamax"
	Hero.save["status"]["speed"] = "Hero.speed"
	Hero.save["status"]["speed"] = "Hero.arrows"
	INI.save("hero.INI", Hero.save)
end 




function Hero:statusCheck()
	-- basic, experience, health, mana, oht status check. nearly in every state avaible
	Gameelement.statusCheck(self)
	if self.exp > self.level * 20 then self:levelUp() end
end
